Skip to content

tools/qvm-run: translate negative return codes (signals) to positive exit codes#457

Open
EliasDevv wants to merge 1 commit intoQubesOS:mainfrom
EliasDevv:main
Open

tools/qvm-run: translate negative return codes (signals) to positive exit codes#457
EliasDevv wants to merge 1 commit intoQubesOS:mainfrom
EliasDevv:main

Conversation

@EliasDevv
Copy link
Copy Markdown

When qvm-run is interrupted via SIGINT (ctrl-c), subprocess.wait()
returns a negative value (-signal). This translates negative return
codes to positive exit codes using abs(retcode) + 128, consistent
with shell signal handling conventions.

Fixes QubesOS/qubes-issues#10468

@EliasDevv
Copy link
Copy Markdown
Author

I'm aware the commits are not GPG-signed yet. I'm setting up commit signing and will force-push signed commits shortly.

@ben-grande
Copy link
Copy Markdown
Contributor

Please change the title of the commit message. "Translating return code" is what had to be done to accomplish the proposed goal. What this commit is about is exiting with the appropriate code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

qvm-run returns nonzero/error upon SIGHUP (and SIGKILL) but 0/success upon SIGINT

2 participants